/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 824202
 */
@Entity
@Table(name = "formaspago")
@NamedQueries({
    @NamedQuery(name = "Formaspago.findAll", query = "SELECT f FROM Formaspago f")})
public class Formaspago implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "formapago")
    private List<Egresos> egresosList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "formapago")
    private List<Ingresos> ingresosList;

    public Formaspago() {
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Formaspago(Integer id) {
        this.id = id;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Formaspago(Integer id, String descripcion) {
        this.id = id;
        this.descripcion = descripcion;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Integer getId() {
        return id;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setId(Integer id) {
        this.id = id;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public String getDescripcion() {
        return descripcion;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public List<Egresos> getEgresosList() {
        return egresosList;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setEgresosList(List<Egresos> egresosList) {
        this.egresosList = egresosList;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public List<Ingresos> getIngresosList() {
        return ingresosList;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setIngresosList(List<Ingresos> ingresosList) {
        this.ingresosList = ingresosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Formaspago)) {
            return false;
        }
        Formaspago other = (Formaspago) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return descripcion;
    }
    
}
